//筛选值缓存--dom方式
function savekeywords(key,val){
	var obj = $("input[name=keywordsCache]");
	tmp = eval('(' + obj.val() +')');
	tmp[key]=val;
	obj.val(JSON.stringify(tmp));
}
//筛选值缓存获取
function getkeywords(key){
	var obj = $("input[name=keywordsCache]").val();
	tmp = eval('(' + obj +')');
	return tmp[key];
}

//标签
function getLabel(labels) {
    var html = '';
    if (labels && labels != null && typeof labels != 'undefined') {
        var label_style = '';
        if(typeof labels == 'object'){
            $.each(labels, function (i, obj) {
                label_style = '';
                switch (obj.style) {
                    case 'red':
                        label_style = "";
                        break;
                    case 'green':
                        label_style = "layui-bg-green";
                        break;
                    case 'orange':
                        label_style = "layui-bg-orange";
                        break;
                    case 'blue':
                        label_style = "layui-bg-blue";
                        break;
                    default :
                        label_style = '';
                }
                html += '<span class="layui-badge ' + label_style + '">' + obj.name + '</span>&nbsp;';
            });
        }
    }
    return html;
}